import { Component, OnDestroy, OnInit } from '@angular/core';
import { Title } from '@angular/platform-browser';
import { Router } from '@angular/router';
import { BtnNaviSharedService } from 'src/app/services/btn-navi-shared.service';

@Component({
  selector: 'app-personal-passport-success',
  templateUrl: './personal-passport-success.component.html',
  styles: [`
  html,body{margin:0;padding:0;width:100%;height:100%;}
  #embed_page{margin: auto 0;width:100%;height:100%}
  .container{width:inherit;height:inherit;justify-content: center;align-items: center;display:flex}
  .embed-tip-box{height:auto;display:inline-block;}
  `]
})
export class PersonalPassportSuccessComponent implements OnInit, OnDestroy {
  private listenFunc!: any;

  constructor(
    private title: Title,
    private router: Router,
    private btnNaviSharedService: BtnNaviSharedService) {
    this.btnNaviSharedService.active(false);//不需要全局的导航
  }

  ngOnInit(): void {
    this.title.setTitle('个人中心:修改密码成功');
    this.listenFunc = setTimeout(() => {
      //跳转:/member/home
      this.router.navigate(['member', 'home']);
    }, 1500);
  }

  ngOnDestroy(): void {
    clearTimeout(this.listenFunc);
  }
}
